#pragma once

#include <QtWidgets/QWidget>
#include "ui_calculator.h"
#include <qstack.h>
#include <string.h>

class calculator : public QWidget
{
	Q_OBJECT

public:
	calculator(QWidget *parent = nullptr);
	~calculator();

private slots:
	void on_oneButton_clicked();
	void on_twoButton_clicked();
	void on_threeButton_clicked();
	void on_fourButton_clicked();
	void on_fiveButton_clicked();
	void on_sixButton_clicked();
	void on_sevenButton_clicked();
	void on_eightButton_clicked();
	void on_nineButton_clicked();
	void on_zeroButton_clicked();

	void on_addButton_clicked();
	void on_subButton_clicked();
	void on_mulButton_clicked();
	void on_divButton_clicked();

	void on_leftButton_clicked();
	void on_rightButton_clicked();

	void on_clearButton_clicked();
	void on_deleteButton_clicked();
	void on_equalButton_clicked();
private:

	int priority(char ch);

	Ui::calculatorClass ui;

	QString expression;
};
